package com.ruoyi.project.digital.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.digital.domain.Payinfo;
import com.ruoyi.project.digital.mapper.PayinfoMapper;
import com.ruoyi.project.digital.service.IPayinfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 费用支付信息Service业务层处理
 *
 * @author ruoyi
 * @date 2020-12-17
 */
@Service
public class PayinfoServiceImpl implements IPayinfoService
{
    @Autowired
    private PayinfoMapper payinfoMapper;

    /**
     * 查询费用支付信息
     *
     * @param id 费用支付信息ID
     * @return 费用支付信息
     */
    @Override
    public Payinfo selectPayinfoById(Long id)
    {
        return payinfoMapper.selectPayinfoById(id);
    }

    /**
     * 查询费用支付信息列表
     *
     * @param payinfo 费用支付信息
     * @return 费用支付信息
     */
    @Override
    public List<Payinfo> selectPayinfoList(Payinfo payinfo)
    {
        return payinfoMapper.selectPayinfoList(payinfo);
    }

    /**
     * 新增费用支付信息
     *
     * @param payinfo 费用支付信息
     * @return 结果
     */
    @Override
    public int insertPayinfo(Payinfo payinfo)
    {
        payinfo.setCreateTime(DateUtils.getNowDate());
        return payinfoMapper.insertPayinfo(payinfo);
    }

    /**
     * 修改费用支付信息
     *
     * @param payinfo 费用支付信息
     * @return 结果
     */
    @Override
    public int updatePayinfo(Payinfo payinfo)
    {
        payinfo.setUpdateTime(DateUtils.getNowDate());
        return payinfoMapper.updatePayinfo(payinfo);
    }

    /**
     * 批量删除费用支付信息
     *
     * @param ids 需要删除的费用支付信息ID
     * @return 结果
     */
    @Override
    public int deletePayinfoByIds(Long[] ids)
    {
        return payinfoMapper.deletePayinfoByIds(ids);
    }

    /**
     * 删除费用支付信息信息
     *
     * @param id 费用支付信息ID
     * @return 结果
     */
    @Override
    public int deletePayinfoById(Long id)
    {
        return payinfoMapper.deletePayinfoById(id);
    }

    /**
     * 查询申请支付信息
     */
    @Override
    public Payinfo selectByApplyId(Long applyId){
        return payinfoMapper.selectPayinfoByApplyId(applyId);
    }

    /**
     * 查询申请支付信息
     */
    @Override
    public Payinfo selectByPayNo(String payNo){
        return payinfoMapper.selectByPayNo(payNo);
    }

    @Override
    public int updatePayByApplyId(Payinfo payinfo) {
        return payinfoMapper.updatePayByApplyId(payinfo);
    }
}
